﻿

using log4net;
using Microsoft.Extensions.Logging;
namespace CKS2320.Common.Utils
{

    public class LogService
    {
        private readonly ILogger<LogService> _logger;

        public LogService(ILogger<LogService> logger)
        {
            _logger = logger;
        }

        public void LogOp10(string message, LogLevel logLevel= LogLevel.Information)
        {
            var logger = LogManager.GetLogger("OP10");
            if (logLevel == LogLevel.Information)
            {
                logger.Info(message);
            }
            else if (logLevel == LogLevel.Error)
            {
                logger.Error(message);
            }
            else
            {
                logger.Info(message);
            }
        }

        public void LogOp20(string message, LogLevel logLevel = LogLevel.Information)
        {
            var logger = LogManager.GetLogger("OP20");
            if (logLevel == LogLevel.Information)
            {
                logger.Info(message);
            }
            else if (logLevel == LogLevel.Error)
            {
                logger.Error(message);
            }
            else
            {
                logger.Info(message);
            }
        }

        public void LogOp30(string message, LogLevel logLevel = LogLevel.Information)
        {
            var logger = LogManager.GetLogger("OP30");
            if (logLevel == LogLevel.Information)
            {
                logger.Info(message);
            }
           else if (logLevel == LogLevel.Error)
            {
                logger.Error(message);
            }
            else
            {
                logger.Info(message);
            }
        }
    }

}
